<div class="bDiv" style="height: auto;">
    <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
        <table>
            <tbody>
            <volist name="auths" id="auth" key="k">
                <tr>
                    <td align="center" axis="col0">
                        <div style="width: 50px;">{$auth.auth_id}</div>
                    </td>
                    <td class="handle">
                        <div style="text-align:left;min-width:50px !important; max-width:inherit !important;">
                              <span class="btn">
                                  <em><i class="fa fa-cog"></i>操作<i class="arrow"></i></em>
                                  <ul>
                                      <li><a target="_blank" href="{:U('Author/download_auth', array('id'=> $auth['auth_id']))}">下载</a></li>
                                      <li><a data-id="{$auth['auth_id']}" class="del_auth">删除</a></li>
                                  </ul>
                              </span>
                        </div>
                    </td>
                    <td align="center" axis="col0">
                        <div style="text-align: center; width: 180px;">{$auth.company}</div>
                    </td>
                    <td align="left" class="">
                        <div style="text-align: center; width: 130px;">{$auth.url}</div>
                    </td>
                    <td align="center" axis="col0">
                        <div style="text-align: center; width: 100px;">{$auth.ip}</div>
                    </td>
                    <td align="center" axis="col0">
                        <div style="text-align: center; width: 100px;">{$auth.use_end}</div>
                    </td>
                    <td align="center" axis="col0">
                        <div style="text-align: center; width: 80px;">{$auth.auth_salt}</div>
                    </td>
                    <td align="center" axis="col0">
                        <div style="text-align: center; width: 240px;">{$auth['auth_code']}</div>
                    </td>
                    <td align="" class="" style="width: 100%;">
                        <div>&nbsp;</div>
                    </td>
                </tr>
            </volist>
            </tbody>
        </table>
        {$page}
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        // 刷选条件 鼠标 移动进去 移出 样式
        $(".hDivBox > table > thead > tr > th.mhover").mousemove(function(){
            $(this).addClass('thOver');
        }).mouseout(function(){
            $(this).removeClass('thOver');
        });

        $(".pagination a").click(function(){
            cur_page = $(this).data('p');
            ajax_get_table(cur_page);
        });

        $(".del_auth").click(function(){
            var auth_id = $(this).data("id");
            var this_dom = $(this);
            layer.confirm('您确认删除此授权吗？', {
                btn: ['确认','取消']
            }, function(){
                $.ajax({
                    url: "{:U('Author/del_auth')}",
                    type: "post",
                    data: {id: auth_id},
                    success: function (data) {
                        if(data.status == "success"){
                            layer.alert("删除成功");
                            this_dom.parents("tr").remove();
                        }else{
                            layer.alert(data.msg);
                        }
                    }
                });
            });
        });
    });
</script>